﻿using System.Windows;

namespace Gmantis.Controls.DataGrid
{
    internal sealed class CellRecyclingKey
    {
        // Fields
        private object contentRecyclingKey;
        private Style contentStyle;
        private object presenterRecyclingKey;
        private Style presenterStyle;

        // Methods
        public CellRecyclingKey(object presenterRecyclingKey, Style presenterStyle, object contentRecyclingKey, Style contentStyle)
        {
            this.presenterRecyclingKey = presenterRecyclingKey;
            this.presenterStyle = presenterStyle;
            this.contentRecyclingKey = contentRecyclingKey;
            this.contentStyle = contentStyle;
        }

        public override bool Equals(object obj)
        {
            CellRecyclingKey key = obj as CellRecyclingKey;
            return ((((key != null) && this.presenterRecyclingKey.Equals(key.presenterRecyclingKey)) && (object.Equals(this.presenterStyle, key.presenterStyle) && this.contentRecyclingKey.Equals(key.contentRecyclingKey))) && object.Equals(this.contentStyle, key.contentStyle));
        }

        public override int GetHashCode()
        {
            int num = 0;
            num ^= this.presenterRecyclingKey.GetHashCode();
            if (this.presenterStyle != null)
            {
                num ^= this.presenterStyle.GetHashCode();
            }
            num ^= this.contentRecyclingKey.GetHashCode();
            if (this.contentStyle != null)
            {
                num ^= this.contentStyle.GetHashCode();
            }
            return num;
        }
    }
}
